About 493 letters
About 2 minutes
Description: Get the length (by calling the object's __len__
method).
def len(obj):
'''
Get length
:param obj: An object
:return: The length of the object
'''
Example:
print(len('hello world'))
print(len([1, 2, 3, 4, 5]))
print(len({'name': 'Alice', 'age': 17}))
Created in 5/15/2025
Updated in 5/16/2025